<template>
  <div>
    <ul>
      <li v-for="(item, index) in arr" :key="index">{{ item }}</li>
    </ul>
    <button @click="change">修改数组元素</button>
    <button @click="num">修改数组任意一项</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [4, 5, 6, 2, 3],
    }
  },
  methods: {
    change() {
      this.arr.push(this.arr[0])
      this.arr.splice(0, 1)
    },
    num() {
      this.$set(this.arr, 0, 100)
    },
  },
}
</script>

<style></style>
